home *** CD-ROM | disk | FTP | other *** search
/ Mastering Microsoft Visual Basic 5 / Mastering Microsoft Visual Basic 5.ISO / media / ch03 / v03a010.cc < prev    next >
Text File  |  1997-01-24  |  3KB  |  33 lines

  1. 0, In this animation, we will take a look at the Recordset object.
  2. 4, You use Recordset objects to manipulate data in a database at the record level.
  3. 11,  There are five types of recordset objects available in data access objects: table type, dynaset type, snapshot type, forward only type and dynamic type.
  4. 23, A recordset object represents the records in a table or the records that result from running query.
  5. 30, You use the OpenRecordset method of the Database object to create a recordset object.
  6. 36, Here, we are creating a dynaset type recordset based on a SQL statement.
  7. 41, Once you have created the recordset you can add, delete, and edit records in the recordset.
  8. 49, To add new records to the recordset, you use the AddNew method of the recordset object.
  9. 55, The position of the new record depends on the type of recordset.
  10. 59, In a dynaset type of recordset, records are inserted at the end of the recordset, regardless of any sorting or ordering rules that were in effect when the recordset was opened.
  11. 70, After you modify the new record, you use the Update method of the Recordset object to save the changes and add the record to the recordset.
  12. 79, No changes will occur in the database until you use the Update method.
  13. 84, Remember, before you can delete a record from a recordset, the recordset must contain a current record.
  14. 91, If there are no current records in the recordset, a run-time error occurs.
  15. 97, In an updateable recordset object, the Delete method removes the current record and makes it inaccessible.
  16. 104, Although you can't edit or use the deleted record, it remains current.
  17. 108, Once you move on to another record you can't make the deleted record current again.
  18. 113, Any subsequent references to a deleted record in a recordset will be invalid and produce an error.
  19. 120, To make changes to an existing record, you use the Edit method of the Recordset object.
  20. 126, When you edit a record, the changes made to the current record's fields are copied into the copy buffer.
  21. 133, After you make the edits to the record, you use the Update method to save your changes.
  22. 139, Now let's take a look at moving within a Recordset object.
  23. 144, To move to a particular record within a recordset, you apply move methods.
  24. 149, For example, a MoveFirst method points to the very first record in the recordset.
  25. 155, Similarly, you can use the MoveLast method to move the last record in the recordset.
  26. 162, When you are moving through a recordset, it is important to stay within the recordset boundaries.
  27. 167, What happens when you try to move to the next record when you are already pointing at the last record?
  28. 173, In a situation like this, you need to check the end of file, or EOF, property of the recordset object.
  29. 181, When you try to move past the last record, the EOF property is set to true but no error is generated.
  30. 189, If you try another move next operation, a run-time trappable error is created.
  31. 194, You must trap this error using an appropriate error handler.
  32. 198, Similarly, you use the beginning of file or BOF property of the recordset to prevent moving past the beginning of the recordset.
  33. 208, END